<?php $this->load->view('header', $head); ?>
<div data-role="page" id="poll-result-question">
	<div data-role="header">
		<h1>설문결과</h1>
		<a href="<?=site_url()?>" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a>
	</div><!-- /header -->
	<div data-role="content">
		<?=form_open('ajax/response_result', array('class' => 'ajax-form'))?>
			<ul data-role="listview" data-inset="true">
				<li data-role="list-divider">
					설문정보
				</li>
				<li data-role="fieldcontain">
					<p>제목: <?= $poll->title ?></p>
					<p>분류: <?= category_str($poll->category) ?></p>
					<p>키워드: <?= $poll->keyword ?></p>
					<p>작성자: <?= $username->name ?></p>
					<p>설문기간: <?= $poll->poll_start.' - '.$poll->poll_end ?></p>
			<?php if( ! empty($poll->conditions)): ?>
					<li data-role="list-divider">
						응답자 통계
					</li>
					<li>
						<div id="chart_gender_div" style="width:100%;"></div>
						<div id="chart_age_div" style="width:100%;"></div>
						<div id="chart_education_div" style="width:100%;"></div>
					</li>
			<?php endif; ?>
				<!--문항별 답변 목록 비율-->
			<?php  foreach($poll->questions as $questions):	?>
				<li data-role="list-divider">
					<?=$questions->title?>
				</li>
				<li>
					<div class="chart-div"></div>
				</li>
			<?php endforeach; ?>
				
			</ul>
			<?=validation_errors()?>
		<?=form_close()?>
	</div><!-- /content -->
	<div data-role="footer">&nbsp;</div>
	<script type="text/javascript">
		var RESULT_DATA = <?=json_encode($cnt)?>;
		var RESULT_VOTE = <?=json_encode($cnt_vote)?>;
	</script>
</div><!-- /page page-add-question -->

<?php $this->load->view('footer'); ?>